import UrlSearchParams from 'url-search-params'

export const transObjToSearch = (query) => {
  if (typeof query !== 'object') return
  const search = new UrlSearchParams()
  Object.keys(query).forEach(key => search.append(key, query[key]))
  return search
}
